// 创建一个路由器，并暴露出去

// 第一步：引入createRouter
import {createRouter,createWebHistory} from 'vue-router'

// 引入一个一个可能要呈现组件
import HomeView from '../views/HomeView.vue';
import VideoView from '../views/VideoView.vue';
import CartView from "../views/CartView.vue";
import ChatView from "../views/ChatView.vue";
import UserView from '../views/UserView.vue';


// 第二步：创建路由器
const router = createRouter({
    history:createWebHistory(), //路由器的工作模式（稍后讲解）
    routes:[ //一个一个的路由规则
        {
            name:'Home',
            path:'/home',
            component:HomeView
        },
        {
            name:'Videoo',
            path:'/video',
            component:VideoView
        },
        {
            name:'Chat',
            path:'/chat',
            component:ChatView
        },
        {
            name:'Cart',
            path:'/cart',
            component:CartView
        },
        {
            name:'User',
            path:'/user',
            component:UserView,

        },
        {
            path:'/',
            redirect:'/home'
        }
    ]
})

// 暴露出去router
export default router
